From: Marco Trevisan (TreviƱo) Date: Thu, 10 Sep 2026 12:21:36 +0000 (+0200) Subject: keyboard: Clear modifiers when the layout is rebuilt X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~6^2^2~16 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=61b16d4124d2d15e5bf98f5bcebbecedf9d28c96;p=gnome-shell.git keyboard: Clear modifiers when the layout is rebuilt The modifiers and the modifier keys are not cleared when the layout is rebuilt, and this may cause access to destroyed objects. So clear them before rebuilding them again when adding the row keys. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9408 Part-of: (cherry picked from commit 7d8323abb81215dc96f716fd66cad42772993685) --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 80f54d1a1..da9a1ed93 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1430,6 +1430,8 @@ export const Keyboard = GObject.registerClass({ purpose === Clutter.InputContentPurpose.ALPHA || purpose === Clutter.InputContentPurpose.PASSWORD || purpose === Clutter.InputContentPurpose.TERMINAL; + this._modifiers.clear(); + this._modifierKeys.clear(); keyboardModel.getLevels().forEach(currentLevel => { const levelLayout = new KeyContainer();